package org.seed.mybatis.springboot;

import org.seed.mybatis.springboot.scatter.ScatterInfo;

import java.util.HashMap;
import java.util.Map;

public class MapperDatasourceMapContext {

    private static Map<String, String> mapperDatasourceNameMap = new HashMap<>();
    private static Map<String, ScatterInfo> mapperScatterMap = new HashMap<>();


    public static void putMapperDatasource(String mapperBeanName, String datasourceName) {
        mapperDatasourceNameMap.put(mapperBeanName, datasourceName);
    }

    public static String getDatasourceName(String mapperBeanName) {
        return mapperDatasourceNameMap.get(mapperBeanName);
    }


    public static void putScatterInfo(String mapperBeanName, ScatterInfo scatterInfo) {
        mapperScatterMap.put(mapperBeanName, scatterInfo);
    }

    public static ScatterInfo getScatterInfo(String mapperBeanName) {
        return mapperScatterMap.get(mapperBeanName);
    }


}
